﻿using System;


namespace MyAlarm
{
    public delegate void MyTick(object sender, Time time);
    public delegate void MyAlarm(object sender, Time time);
    public class Time
    {

        public int hour { get; set; }
        public int munite { get; set; }
        public int second { get; set; }

    }

    public class Work {
        public event MyTick OnTick;
        public event MyAlarm OnAlarm;
        public void Showtime(int a, int b, int c)
        {
            Console.WriteLine("hour:" + a + ",munite:" + b + ",second:" + c);
            Time time = new Time() { hour = a, munite = b, second = c };
            OnTick(this, time);
            OnAlarm(this, time);
        }
    }

    public class Go{
        public Work work = new Work();
        public  Go(){
            work.OnTick+=Btn_TIck;
            work.OnAlarm += Btn_Alarm;
            }
        void  Btn_TIck(object sender, Time time) { Console.WriteLine("滴答一下"); }
        void Btn_Alarm(object sender, Time time) { Console.WriteLine("响一下"); }

    }

    class main {
        public static void Main(string[] args) {
            Go go1 = new Go();
            go1.work.Showtime(20, 0, 2);
        
        }
    }




}


